﻿<controls:ChildWindow x:Class="SinaDesktop.Controls.UserMentionChildWindow"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Width="400" Height="200" 
           xmlns:converters="clr-namespace:SinaDesktop.Converters"
           Title="转发微博" Style="{StaticResource ChildWindowStyle}" >
    <controls:ChildWindow.Resources>
        <converters:TextCountConverter x:Key="TextCountConverter" />
        <converters:TextCountVisibilityConverter x:Key="TextCountVisibilityConverter" />
    </controls:ChildWindow.Resources>
    
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <TextBox x:Name="txtMentionContent" Width="370" Margin="2" Height="50" HorizontalAlignment="Left" TextWrapping="Wrap" AllowDrop="True" VerticalScrollBarVisibility="Auto"/>
                <TextBlock x:Name="tbTextCount" Grid.Column="1" FontSize="48" HorizontalAlignment="Right" VerticalAlignment="Center" 
                                   Text="{Binding Path=Text.Length, ElementName=txtMentionContent, Converter={StaticResource TextCountConverter}}" 
                                   Visibility="{Binding Path=Text.Length, ElementName=txtMentionContent, Converter={StaticResource TextCountVisibilityConverter}}"
                                   FontFamily="Arial" FontWeight="Bold" Margin="-160,0,20,0" Opacity=".05"/>
            </Grid>
            
            <CheckBox x:Name="chkComment" Content="同时评论给作者" Grid.Row="1" Margin="2,0,2,2" />
        </Grid>

        <Button x:Name="CancelButton" Content="取消" Click="CancelButton_Click" Width="75" Height="30" Margin="79,0,0,0" HorizontalAlignment="Center" Grid.Row="1" />
        <Button x:Name="OKButton" Content="提交转发" Click="OKButton_Click" Width="75" Height="30" Margin="0,0,79,0" HorizontalAlignment="Center"  Grid.Row="1" />
    </Grid>
</controls:ChildWindow>